home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-20 / nos_kit3.zip / REWRITE.DOC < prev    next >
Text File  |  1990-11-07  |  4KB  |  95 lines

  1. =========================
  2. = tcp-mail.v38  Feb, 90 =
  3. =========================
  4. As an aside, versions 900212 and later supports a file called \SPOOL\REWRITE.
  5. This file is searched after the S command is typed on the mailbox and
  6. the address is rewritten according to the file. An entry like
  7.  
  8. *@sm*.ampr.org $1%sm$2.ampr.org@sics.se
  9.  
  10. would rewrite "foo@sm0xxx.ampr.org" into "foo%sm0xxx.ampr.org@sics.se".
  11. The rewrite file is particulary useful when you are receiving bulletins
  12. from a packet BBS. The entry
  13.  
  14. *@mblbbs mblbbs
  15.  
  16. would map a message for "all@mblbbs" into the local username (i.e. mail area)
  17. "mblbbs".
  18. Newer versions of NOS will allow for a third entry on the rewrite line,
  19. namely an 'r' character. This character indicates that the rewrite file
  20. should be read once again. This allows for entries like:
  21.  
  22. *@myhost.ampr.org $1 r
  23. *!* $2@$1 r
  24.  
  25. where the first line simply removes the string "@myhost.ampr.org" from the
  26. end of the address, when applicable, and recurses the rewrite file.
  27. The second line would map "host1!host2!user" into "host2!user@host1" and
  28. recurse the rewrite file.
  29. Unfortunately, "*%* $1@$2" would not map "user%host2%host1" into
  30. "user%host2@host1" but rather into "user@host2%host1", so one has to be
  31. careful.
  32.  
  33. So, NOS now has great flexibility in the way it handles mail addresses.
  34. The rewrite file is scanned first, and it can be used to rewrite almost
  35. any kind of mail addresses. Then, the alias file is scanned. It is used
  36. to map local usernames into one or more addresses. Please note that the
  37. differences are that the rewrite file cannot handle multiple addresses,
  38. while the alias file only operates on local addresses.
  39.  
  40. ===============================================================================
  41. = tcp-mail.v74  Oct, 90 =
  42. =========================
  43. When a message is entered to the mailbox, the address is rewritten
  44. according to rules in the /spool/rewrite file. The first word on
  45. each line in the rewrite file is an address using wildcards. If that
  46. address matches the address you are trying to rewrite, it is rewritten
  47. according to the format of the second word. If the third word is an 'r',
  48. the rewrite procedure will be repeated, now using the new address as
  49. input.
  50.  
  51. Ok, so here is a sample /spool/rewrite file for a machine with the
  52. hostname sk0we.ampr.org:
  53.  
  54. *!* $2@$1 r
  55. *@sk0we.ampr.org $1 r
  56. *@*.ampr.org $1@$2.ampr.org
  57. sm0rgv@* sm0rgv
  58. *@w3ya* w3ya
  59. *@k* $1%k$2%w3iwi.ampr.org@tomcat.gsfc.nasa.gov
  60.  
  61. The first line means that addresses written in the "host!user" format
  62. should be rewritten to "user@host" and then the rewrite procedure
  63. should be repeated.
  64.  
  65. The second line converts the address "user@sk0we.ampr.org" into the
  66. local address "user" and then repeats the rewrite procedure.
  67.  
  68. The third line seems to do nothing. It just converts "user@host.ampr.org"
  69. to "user@host.ampr.org". But it also exits the rewrite procedure
  70. since the line does not end with an 'r'. Any address ending with
  71. ".ampr.org" will not be converted further.
  72.  
  73. The line "sm0rgv@* sm0rgv" will keep mail for sm0rgv on the local
  74. machine even if it is mistakenly addressed to another BBS, such as
  75. "sm0rgv@w3iwi". The line will however fail to convert addresses such
  76. as "sm0rgv@w3iwi.ampr.org" because of the line described in the
  77. previous paragraph.
  78.  
  79. The line "*@w3ya* w3ya" will leave mail for "user@w3ya" in the local
  80. message area named "w3ya". The same goes for mail using some sort of
  81. hierarchical routing designators such as "user@w3ya.state.na.us". The
  82. only exception is for mail addressed to "user@w3ya.ampr.org" as
  83. described above.
  84.  
  85. The line "*@k* $1%k$2%w3iwi.ampr.org@tomcat.gsfc.nasa.gov" is an
  86. example of how to establish an Internet "wormhole." Suppose I want to
  87. forward all mail to stations with callsigns starting with K to W3IWI
  88. through the Internet. The line quoted above would do it. But if the
  89. mail for "user@kxxxx" is received by w3iwi.ampr.org with SMTP, there
  90. might be some problems because the rewrite file is not scanned when
  91. mail is received with SMTP. This could easily be changed however. Let
  92. me know if this is causing you any inconveniencies.
  93.  
  94. Anders
  95.